/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package modela;

import java.awt.Dimension;
import java.net.URL;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

/**
 *
 * @author usuario
 */
public class Fondo  {

    public void Fondo(){

    }

    public JLabel getFondo(){

        

        JLabel lblFondo = new JLabel();
        //lblFondo.setBounds(0,0,662,597);
        lblFondo.setIcon(get_icon_fondo());
        lblFondo.setVisible(true);
        lblFondo.setSize(new Dimension(882,796));
        //lblFondo.setLocation(10, 10);
        return lblFondo;
    }

    public Icon get_icon_fondo(){
        ImageIcon icono;
        URL url = null;
        try {
            url = getClass().getClassLoader().getResource("IMG/fondo02.png");
            icono = new ImageIcon(url);
            if (icono == null) {
                System.err.println("BASURA");
            }
            return icono;

        } catch (Exception e) {
            System.out.println("No se pudo cargar la imagen  de " + url);
            System.out.println("El error fue : " + e.getClass().getName() + " " + e.getMessage());
            System.exit(0);
            return null;
        }
    }
}
